<?php
/**
 * [PHPFOX_HEADER]
 */

defined('PHPFOX') or exit('NO DICE!');

/**
 * 
 * 
 * @copyright		[PHPFOX_COPYRIGHT]
 * @author  		Raymond Benc
 * @package 		Phpfox_Component
 * @version 		$Id: info.class.php 2518 2011-04-11 19:18:17Z Raymond_Benc $
 */
class Event_Component_Block_Logo extends Phpfox_Component
{
	/**
	 * Class process method wnich is used to execute this component.
	 */
	public function process()
	{
            
		// Used in the template to set the ajax call

			$aUser = $this->getParam('aEvent');

                    $aCoverPhoto = Phpfox::getService('photo')->getCoverPhoto($aUser['cover_photo_id']);

                    if (!isset($aCoverPhoto['photo_id']))
                    {
                            $this->template()->assign(array('bNoPrefix' => true,
                                'bDefaultCover' => true));
                    }

                    if (!Phpfox::getService('user.privacy')->hasAccess($aUser['user_id'], 'profile.view_profile'))
                    {
                            return false;
                    }		
//               
//		$sPagesUrl = '';
//		if ($bIsPages)
//		{
//			$aPage = $this->getParam('aPage');
//			
//			$this->template()->assign('sPagesLink', $aPage['link']);
//		}
//		
		$this->template()->assign(array(
                                'event_link' => $aUser['event_link'],
                                'eventId' => $aUser['event_id'],
				'aCoverPhoto' => $aCoverPhoto,
				'bRefreshPhoto' => ($this->request()->getInt('coverupdate') ? true : false),
				'bNewCoverPhoto' => ($this->request()->getInt('newcoverphoto') ? true : false),
				'sLogoPosition' => isset($aUser['cover_photo_position']) ? $aUser['cover_photo_position'] : 0,
//				'bIsPages' => false,
                                'bIsEvent' => true,
                                'sAjaxModule' => 'event'
			)
		);
	}
	
	/**
	 * Garbage collector. Is executed after this class has completed
	 * its job and the template has also been displayed.
	 */
	public function clean()
	{
		(($sPlugin = Phpfox_Plugin::get('event.component_block_info_clean')) ? eval($sPlugin) : false);
	}
}

?>